//
//  DetailCommentWithOtherTableViewCell.m
//  TestApplication
//
//  Created by Hanlingyu on 16/9/8.
//  Copyright © 2016年 ltq. All rights reserved.
//

#import "DetailCommentWithOtherTableViewCell.h"
#import "HomeChanneldetailCommentModel.h"
#import "UIButton+WebCache.h"
#import "UIImageView+WebCache.h"
@interface DetailCommentWithOtherTableViewCell ()

@property (weak, nonatomic) IBOutlet UIButton *headerImageButton;
@property (weak, nonatomic) IBOutlet UILabel *replyNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *replyContentLabel;


@end


@implementation DetailCommentWithOtherTableViewCell

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        
        
    }
    return self;
}

- (void)setCommentModel:(HomeChanneldetailCommentModel *)commentModel {
    _commentModel = commentModel;
    _replyNameLabel.text = _commentModel.uname;
    if (_commentModel.replyName) {
        _replyContentLabel.text = [NSString stringWithFormat:@"回复 %@: %@", _commentModel.replyName, _commentModel.content];
    } else {
        _replyContentLabel.text = _commentModel.content;
    }
    NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://qn.zheli.io/%@", _commentModel.feelAvatar]]];
    UIImage *image = [UIImage imageWithData:data];
    image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [_headerImageButton setImage:image forState:UIControlStateNormal];
    
//    [_headerImageButton sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://qn.zheli.io/%@", _commentModel.feelAvatar]] forState:UIControlStateNormal];
//    NSLog(@"http://qn.zheli.io/%@", _commentModel.feelAvatar);
}


- (void)layoutSubviews {
    [super layoutSubviews];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
